home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v9n02.arc / BU.BAT < prev    next >
DOS Batch File  |  1990-01-02  |  2KB  |  68 lines

  1.  
  2. :--- BU.bat
  3. @ECHO off
  4. IF %2 '==' GOTO syntax
  5. IF %1 == ? GOTO syntax
  6. FOR %%o in (a e m A E M) do if %2==%%o GOTO test
  7. FOR %%o in (c C) do GOTO create
  8. GOTO syntax
  9. :test
  10.   IF EXIST A:\%1.DIR GOTO ok
  11.   ECHO %1.dir was not found on drive A:.  Place the   %1  back-up disk in the
  12.   ECHO A: drive and then press any key to proceed.  You may quit and then type 
  13.   ECHO .
  14.   ECHO BU %1 c
  15.   ECHO .
  16.   ECHO in order to copy the %1.dir file to the BU diskette.  
  17.   ECHO To quit hold the Ctrl key and press 'c' and then 'y';  
  18.   PAUSE
  19.   GOTO test
  20. :ok
  21. :ADD in the parentheses below the directories on the D: drive.
  22.   FOR %%d IN (asy qb ASY QB) DO IF %%d==%1 GOTO ddrive
  23. :ADD in the parentheses below the directories on the C: drive.
  24.   FOR %%d IN (dos mw wrk DOS MW WRK) DO IF %%d==%1 GOTO cdrive
  25.   GOTO update
  26. :ddrive
  27.   D:
  28.   GOTO l1
  29. :cdrive
  30.   C:
  31. :l1
  32.   cd \%1
  33. :ADD in parentheses below the directories that require custom procedures.
  34.   FOR %%d IN (dos wrk DOS WRK) DO IF %%d==%1 GOTO %1
  35.   GOTO makebu   
  36. :dos
  37.   ECHO Resetting archive bits...
  38.   ATTRIB -A BAT\?????SET.BAT > NUL
  39.   ATTRIB -A BAT\????SET.BAT > NUL
  40.   GOTO makebu
  41. :wrk
  42.   ECHO Resetting archive bits...
  43.   ATTRIB -A SAS\SASWORK\*.* > NUL
  44.   ATTRIB -A SAS\SASUSER\*.* > NUL
  45.   GOTO makebu
  46. :makebu
  47.   ECHO Deleting *.bak file(s)...
  48.   SWEEP IF EXIST *.BAK DEL *.BAK > NUL
  49.   XCOPY *.* A:\/%2/V/S %3
  50.   GOTO end
  51. :create
  52.   ECHO Copying %1.dir to the BU diskette...
  53.   ECHO %1.DIR> A:\%1.DIR
  54.   GOTO end 
  55. :update
  56.   ECHO %1 is not included among the BU directories.  Modify BU.BAT: Add the
  57.   ECHO directory name as indicated in the BU batch program.
  58.   GOTO end
  59. :syntax
  60.   ECHO Syntax:  BU dir a│c│e│m [/P(rompt)[/D:date]]
  61.   ECHO                 │ │ │ └─ archive and reset the archive bit or
  62.   ECHO                 │ │ └─── archive all files or
  63.   ECHO                 │ └───── copy an identifying file to a new BU disk or
  64.   ECHO                 └─────── archive and do not reset the archive bit.
  65. :end
  66.  
  67.  
  68.